package com.dajie.pt.service.utils;

import com.dajie.pt.service.beans.MessageData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 * Created by zhihaosong on 15-11-16.
 */
public class SendData {
    private LinkedList<MessageData> sendData = null;
    private static Logger logger = LoggerFactory.getLogger(SendData.class);

    public SendData(List<MessageData> messageDataList) {
        logger.info("SendData ----> send not delete noEmail counts:{}", messageDataList.size());
        sendData = new LinkedList<MessageData>();
        for (MessageData messageData : messageDataList) {
                sendData.add(messageData);
        }
        //  增加测试的手机号
        logger.info("SendData ----> send not test counts : {}", sendData.size());

       // MessageData messageDataTest1 = sendData.get(0);
       // MessageData messageDataTest2 = sendData.get(1);
       // MessageData messageDataTest3 = sendData.get(2);

       // messageDataTest3.setUid(880225);//wanDong
       // messageDataTest2.setUid(154902);//peiPei
       // messageDataTest1.setUid(34105731);//songZhiHao
       
//        sendData.add(messageDataTest1);
  //      sendData.add(messageDataTest2);
    //    sendData.add(messageDataTest3);

    }

    public synchronized MessageData popSendData() {
        if (sendData.size() != 0) {
            return sendData.poll();
        }
        return null;
    }

    public boolean isEmpty() {
        if (sendData.isEmpty())
            return true;
        return false;
    }

    public int getSendDataSize() {
        return sendData.size();
    }

}
